
import  LexCore from "../build/RdLexCore"
import RdSwitchCore from "../build/RdSwitchCore"
import fs from 'fs';
import RdSyntaxCore from "../build/RdSyntaxCore";
const readline = require('readline')

let lexCore=new LexCore();
/*
const path = require('path');
let fsPath=path.join(__dirname ,"./测试.jsr" )
let lexCore=new LexCore();
lexCore.init();



function read() {
    let data=fs.readFileSync(fsPath);
    lexCore.loadData(data)
}
function write() {

    let data=fs.writeFileSync(fsPath,lexCore.outData());
}*/

let str="把选中的字,移动到最后"
// let ids= lexCore.run(str);
// console.log(ids
//添加词
lexCore.saveWordsStr("选中")
lexCore.saveWordsStr("移动")
lexCore.saveWordsStr("最后" )
lexCore.saveWordsStr("把" )
lexCore.saveWordsStr("到" )
lexCore.saveWordsStr("的" )
lexCore.saveWordsStr("字" )
lexCore.saveWordsStr("," )
//添加语法类型
lexCore.saveNounStr("选中","名词")
lexCore.saveVerbStr("移动","动词")
lexCore.saveNounStr("最后","名词")
lexCore.saveStrucStr("把","结构")
lexCore.saveStrucStr("到","结构")
lexCore.saveStrucStr("的","结构")
lexCore.saveStrucStr("字","结构")
lexCore.saveStrucStr(",","结构")
debugger;

let ids=  lexCore.findWordId(str);
let ides=lexCore.run(ids);


//let yaccType=lexCore.yaccType(ides);
console.log(ides)
//console.log(yaccType)
let srt1=[{type:'把',        'data':'把'},
           {type:'名词',     'data':'选中'},
           {type:'的',       'data':'的'},
           {type:'名词',     'data':'字'},
           {type:'动词',     'data':'移动'},
           {type:'到',       'data':'到'},
           {type:'名词',     'data':'最后'}]


let p =new RdSyntaxCore();


let yaccData=p.run(ides)

console.log(yaccData)

let switchCore=new RdSwitchCore();
let switchData=switchCore.run(yaccData)
console.log(switchData)



class  Ctest{
    static x=2;
    cs(){}
}

class  Xtest{
    
    static x=new Ctest();

    cw(){
    this.x.cs();
    }
}
let x=new Ctest();

console.log(Ctest.x)
console.log(x.x)
x.x=3;
console.log(x.x)
